//
//  GeneralLayer.h
//  SpeedTap
//
//  Created by Chi Ho Chiu on 14/8/11.
//  Copyright 2011 Individual. All rights reserved.
//

#import <Foundation/Foundation.h>
#import "cocos2d.h"

#import "GeneralSprite.h"

@protocol GeneralLayerDelegate;

@interface GeneralLayer : CCLayerColor <GeneralSpriteDelegate>{
@public
    id delegate;
	NSMutableArray *spritesArray;
	
@protected
    int currentWave;
	
}
@property (assign) id<GeneralLayerDelegate> delegate;
@property int currentWave;
@property (nonatomic, retain) NSMutableArray *spritesArray;

//Public Function
-(void) showGuGu:(CGPoint)sourcePos;
-(GeneralSprite *) createSpriteWithType:(ESpriteType)type number:(int)num;
-(NSMutableArray *) shuffleArray:(NSMutableArray *)array; 

//Abstract Function
-(void) createSprites:(NSMutableArray *)numberArray wave:(int)wave;
-(void) startLevel;
-(void) startWave:(int)wave;
-(void) willCompleteLevel;
-(void) willCompleteWave;
-(void) startPerformCorrectAnswer:(GeneralSprite *)sprite;
-(void) startPerformIncorrectAnswer:(GeneralSprite *)sprite;

-(void) ccTouchesBegan:(NSSet *)touches withEvent:(UIEvent *)event;
-(void) ccTouchesEnded:(NSSet *)touches withEvent:(UIEvent *)event;
-(void) ccTouchesCancelled:(NSSet *)touches withEvent:(UIEvent *)event;
-(void) ccTouchesMoved:(NSSet *)touches withEvent:(UIEvent *)event;
@end


@protocol GeneralLayerDelegate

-(void) checkAnswer:(CCSprite *)sprite;
-(void) didCompleteWave;
-(void) didCompleteLevel;
-(void) completePerformCorrectAnswer:(CCSprite *)sprite;
-(void) completePerformIncorrectAnswer:(CCSprite *)sprite;

@end

/*
@protocol GeneralLayerDelegate
-(bool) isLevelComplete;
-(void) levelCompleted;
-(void) gameOver;
-(bool) checkAnswer:(int)iNum;
-(void) deductTime;
-(void) pauseTimer;
-(bool) isWaveComplete;
-(void) waveCompleted;
@end
*/